const express = require("express");
const globalConfig = require('./config')
const loader = require("./loader")

const app = new express();

app.use(express.static("./page/"));

app.post("/editEveryDay", loader.get("/editEveryDay"))
app.get('/queryEveryDay', loader.get("/queryEveryDay"))


app.post("/editBlog", loader.get("/editBlog"))
app.get('/queryBlog', loader.get("/queryBlog"))

app.get("/queryBlogCount", loader.get("/queryBlogCount"))
app.get("/queryBlogById", loader.get("/queryBlogById"))

app.get("/insertComment", loader.get("/insertComment"))
app.get("/queryRandomCode", loader.get("/queryRandomCode"))

app.get("/queryCommentsByBlogId", loader.get("/queryCommentsByBlogId"))
app.get("/queryBlogCommentsCount", loader.get("/queryBlogCommentsCount"))

app.get("/queryTag", loader.get("/queryTag"))
app.get("/queryByTag", loader.get("/queryByTag"))
app.get("/queryByTagCount", loader.get("/queryByTagCount"))
app.get("/queryAllTag", loader.get("/queryAllTag"))
app.get("/queryBlogIdByTagId", loader.get("/queryBlogIdByTagId"))

app.get("/queryAllBlog", loader.get("/queryAllBlog"))
app.get("/queryHotBlog", loader.get("/queryHotBlog"))
app.get("/queryNewComment", loader.get("/queryNewComment"))



app.listen(globalConfig.port, () => {
    console.log(`listening on ${globalConfig.port}`)
})